import Vue from 'vue'
import Router from 'vue-router'

const home = () => import('@/pages/home');
const index = () => import('@/pages/index/index');
const search = () => import('@/pages/search/search');
const my = () => import('@/pages/my/my');

const test = () => import('@/pages/index/test');
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      component: home,
      children:[
          {
              path: '',
              redirect: {name: 'index'}
          },
          {
              path: 'index',
              name: 'index',
              component: index
          },
          {
              path: 'search',
              name: 'search',
              component: search
          },
          {
              path: 'my',
              name: 'my',
              component: my
          }
      ]
    },
    {
        path: '/index/test',
        name: 'test',
        component: test
    }
  ]
})
